package com.xcw.ioexcel;

import java.io.*;

/**
 * @Author bhx
 * @Date 2022/8/4 1:02
 * @Description TODO
 */
public class IOpri {
    public static void main(String[] args) throws IOException {
        /**
         * 文件复制小练习：
         * 从文件夹D:  写出到文件夹D:/excle/ 中
         *
         */
        File file = new File("D:/dcdc/abc.jpg");
        FileInputStream fileInputStream = new FileInputStream(file);
        String path = "D:/excle/";
        String filename = "复制后的xxxx01.txt";
        FileOutputStream fileOutputStream = new FileOutputStream(path + filename);

        byte[] b = new  byte[1024];
        int length;
        while ((length = fileInputStream.read(b)) != -1){
            fileOutputStream.write(b , 0, length);
        }
        fileOutputStream.close();
        fileInputStream.close();

    }

}
